package cn.huobi.feign;

import cn.huobi.user.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServerFallbackFactory implements FallbackFactory<UserServer> {
    @Override
    public UserServer create(Throwable throwable) {
        return new UserServer() {
            @Override
            public User getUserById(Long id) {
                return new User(-1L,"服务熔断","请稍后重试！！！！");
            }
        };
    }
}
